import Cookies from 'js-cookie'

const TokenKey = 'token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

const Id = 'userId'

export function getId() {
  return Cookies.get(Id)
}

export function setId(userId) {
  return Cookies.set(Id, userId)
}

export function removeId() {
  return Cookies.remove(Id)
}

const Roles = 'roles'

export function getRoles() {
  return Cookies.get(Roles)
}

export function setRoles(roles) {
  console.log(roles)
  return Cookies.set(Roles, roles)
}

export function removeRoles() {
  return Cookies.remove(Roles)
}
